//
//  QLBxOrderCostTopCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/23.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLBxOrderCostTopCell.h"

@implementation QLBxOrderCostTopCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (UIButton *)acreatButton:(CGRect)aFrame title:(NSString *)aTitle image:(NSString *)imageName{
    UIButton *newButton = [UIButton buttonWithType:UIButtonTypeCustom];
    newButton.frame = aFrame;
    [newButton setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [newButton setTitle:aTitle forState:UIControlStateNormal];
    [newButton setTitleColor:UIColorFromRGB(0x333333) forState:UIControlStateNormal];
    newButton.backgroundColor = [UIColor whiteColor];
    newButton.titleLabel.font=[UIFont systemFontOfSize:10.0f];
//    [newButton addTarget:self action:@selector(newButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    return newButton;
}

- (void)_creatMainUI{
    
    CGFloat btnwidth = (kScreen_width-20)/3;
    
    CGRect rectButton=CGRectMake(10, 10, btnwidth, 60);
    UIButton *pushButton=[self acreatButton:rectButton title:@"未审批" image:@"NO1"];
    [pushButton verticalImageAndTitle:5];
    pushButton.backgroundColor=[UIColor clearColor];
    [pushButton setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateNormal];
    pushButton.titleLabel.font=[UIFont systemFontOfSize:10];
    [self addSubview:pushButton];
    
    CGRect rectButton1=CGRectMake(btnwidth+10, 10, btnwidth, 60);
    UIButton *push1Button=[self acreatButton:rectButton1 title:@"已审批（张山峰）" image:@"NO2"];
    [push1Button verticalImageAndTitle:5];
    push1Button.backgroundColor=[UIColor clearColor];
    [push1Button setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateNormal];
    push1Button.titleLabel.font=[UIFont systemFontOfSize:10];
    [self addSubview:push1Button];
    
    CGRect rectButton2=CGRectMake(btnwidth*2+10, 10, btnwidth, 60);
    UIButton *push2Button=[self acreatButton:rectButton2 title:@"已审批（李四无）" image:@"NO3"];
    [push2Button verticalImageAndTitle:5];
    push2Button.backgroundColor=[UIColor clearColor];
    [push2Button setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateNormal];
    push2Button.titleLabel.font=[UIFont systemFontOfSize:10];
    [self addSubview:push2Button];
    
    CGFloat eoriX=0;
    if (kScreen_width>320) {
        eoriX=15;
    }
    
    for (int i=0; i<2; i++) {
        UIView *line1=[[UIView alloc] initWithFrame:CGRectMake(90+eoriX+btnwidth*i, 30, btnwidth-60, 0.5)];
        line1.backgroundColor=UIColorFromRGB(0x7cd1a7);
        [self addSubview:line1];
    }
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    
    static NSString *identifiew=@"QLBxOrderCostTopCellId";
    QLBxOrderCostTopCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLBxOrderCostTopCell" owner:nil options:nil] firstObject];
    }
    return cell;
}

@end
